/*
 * @Description: 函数的剖析
 * @Author: zzj
 * @Date: 2021-09-05 10:48:12
 * @LastEditors: zzj
 * @LastEditTime: 2021-09-05 10:54:19
 */

//函数的剖析(构造器函数)
function Animal(name,age){
    this.name = name;
    this.age = age;
}
Animal.prototype.sayHello=function(){
    console.log("hello")
}
var d1 = new Animal("小白",2);
console.log(Animal);
console.log(d1);
d1.sayHello();